package com.demandastatus.activity;


import com.demandasutatus.activity.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ExpandableListView;
import android.widget.Spinner;

import com.demandastatus.model.db.*;
public class cadastroActivity extends Activity {
	
	Spinner listaSistema,listaTipo;
	Button bntAdicionarDem, bntCancelar;
	EditText textSti,  textDtInicio,textDtFim, textRelease;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.cadastro_activity);
		
		//associando componentes
		listaSistema = (Spinner)findViewById(R.id.LISTA_SISTEMAS);
		listaTipo = (Spinner)findViewById(R.id.LISTA_TIPO);
		bntAdicionarDem = (Button)findViewById(R.id.BNT_ADICIONAR_DEM);
		bntCancelar = (Button) findViewById(R.id.BNT_CANCELAR_CAD);
		textDtFim = (EditText)findViewById(R.id.TEXT_DT_FIM);
		textDtInicio = (EditText)findViewById(R.id.TEXT_DT_INICIO);
		textSti = (EditText)findViewById(R.id.TEXT_STI);
		textRelease = (EditText)findViewById(R.id.TEXT_RELEASE);
		
		
		ArrayAdapter<CharSequence> adapterListaSistema = ArrayAdapter.createFromResource(
				this, R.array.array_sistemas, android.R.layout.simple_spinner_item);
		adapterListaSistema.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		
		ArrayAdapter<CharSequence> adapterListaTipo = ArrayAdapter.createFromResource(
				this, R.array.array_tipo, android.R.layout.simple_spinner_item);
		adapterListaTipo.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		
		listaSistema.setAdapter(adapterListaSistema);
		listaTipo.setAdapter(adapterListaTipo);
		
		bntCancelar.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
				
			}
		});
		
		
		bntAdicionarDem.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				
			}
		});
								


	}
	
	public void chamaTelaMain() {
		 
		Intent chamaTelaMain = new Intent(cadastroActivity.this, MainActivity.class);
		cadastroActivity.this.startActivity(chamaTelaMain);
		 
		}

}
